1. Field of the Invention
The present invention generally relates to a digital image processing technology, and more particularly to a method for determining the boundary strength (or boundary filter strength) of edges in a block-based digital encoding image.
2. Description of the Prior Art
A block-based digital image encoding technology typically divides an image frame into many macroblocks (MBs) which are then encoded according to the luminance and chroma data of pixels (picture elements) thereof. For example, in the H.264 coding standard, a macroblock represents an image area containing 16×16 pixels. A macroblock can be encoded in Intra Prediction mode or Inter prediction mode. Intra Prediction is formed based on previously encoded and reconstructed blocks in the same video frame, while Inter Prediction creates a prediction model from one or more previously encoded video frames. Usually, a macroblock tends to be encoded in Inter prediction mode when it is correlated with content of another video frame(s).
Among available Inter prediction encoding techniques, motion compensation no doubt plays an important role. The motion compensation technology creates motion compensation blocks based on previously encoded picture(s), and represents the displacement or shift relative to block(s) of the previously encoded pictures with motion vector(s). The picture used to predict or create the motion compensation block is usually called the reference picture. In addition to motion vectors, encoding data may also include the difference between the reference picture block and the motion compensation block, which is referred to as the prediction residual. In the encoding technology such as H.264, the motion vector accuracy can be down to quarter pixel level.
In an encoding technology such as H.264, the motion compensation block mentioned above can be areas with block sizes of 16×16, 8×16, 16×8 or 8×8 pixels in a macroblock as shown in FIG. 9A. These areas are called partitions. For example, if a macroblock is divided into four 8×8 areas, then the macroblock will include four divided areas from D0 to D3 as shown in FIG. 9A. When the partition is the 8×8 mode, it can be further divided into areas with block sizes of 8×8, 4×8, 8×4, or 4×4 pixels as shown in FIG. 9B. These areas are called sub-partitions. The motion compensation block may also be a sub-partition. Such mechanism in which a macroblock may be further partitioned into motion compensation blocks of variant sizes is known as the tree structured motion compensation. Every motion compensation block may be encoded with one or two motion vectors. When a motion compensation block is encoded with two motion vectors, these two motion vectors can reference the same or different reference pictures. In the encoding technology using a partition or a sub-partition as a motion compensation prediction unit, such as H.264, the blocks located in the same partition (or sub-partition) will lie in the same motion compensation block and contain the same motion vector(s).
In order to improve the encoding efficiency of dynamic areas and static areas in a motion picture, the coding standard such as H.264 may encode each vertically adjacent macroblock pair in either frame mode or field mode. This special coding mechanism is generally called the macroblock adaptive frame/field coding which is hereinafter referred as “MBAFF” for short. Macroblocks encoded in frame mode and field mode are respectively referred to as the Frame MBs and the Field MBs in the following description. When two adjacent macroblocks (may belong to different macroblock pairs) are either both Frame MBs or both Field MBs, they are referred to as having the same parity; otherwise (i.e., one of them is a Frame MB, but the other is a Field MB), they are referred to as having different parities.
The decoding operations in the block-based digital image encoding/decoding system mainly include the inverse quantization and the inverse cosine transformation. The inverse quantization may not completely recover the original image data value, especially for data located in the edge between blocks used as units of the cosine transformation. This problem is called the block effect. The block effect usually causes visual defects on the decoded image, and thus the encoding module and decoding module of the coding technologies such as H.264 may include the function of deblocking process to alleviate or reduce the block effect. FIG. 1 shows a block-based digital image encoder or decoder 100 containing a deblocking module 120 which receives the image data output V of the decoding unit 110, performs deblocking process on the image data V, and then outputs the outcome D(V) after deblocking process to the frame buffer 130. The digital image encoder or decoder 100 generally includes other modules which are not shown in FIG. 1 to simplify the drawing.
The main operations of a conventional deblocking module may be shown by the flow chart of FIG. 2. It includes determining all the edges which need to be deblocked in the image frame (Step 22), determining the boundary strengths of all edges (Step 24), and performing the deblocking process in the image frame based on the boundary strengths (Step 26). Here the edges mean the boundary which locate in the top, bottom, left or right side of a block unit, which may be located inside a macroblock or inside an image frame. In the encoding and decoding technologies such as H.264, the boundary strength can be a value between 0 and 4. The deblocking module skips the deblocking process for any edge with boundary strength 0. The larger the boundary strength is, the stronger the deblocking process will be applied to the pixel data adjacent to the corresponding boundary. For example, the deblocking strength for an edge with boundary strength 4 is generally larger than that for an edge with boundary strength 3, 2, or 1. The deblocking process typically changes the pixel value (either luminance or chroma) lying in both sides of an edge (left and right sides or top and bottom sides), so as to make the difference smaller and accordingly reduce the artificial defects. The larger the boundary strength of an edge is, the stronger the deblocking process therefor is, and the larger the change of values of the pixels lying in both sides of the edge will be.
From above description, when a block-based digitally encoded image is processed with the encoding technology such as H.264, every video frame needs to determine all the boundary strengths efficiently to benefit the proceeding of the entire deblocking process. So there is a need to provide an efficient boundary strength determining method to improve the total performance of the deblocking process as well as the encoding/decoding operations.